package com.tbit.uqbike.service.business.tag;

import com.tbit.uqbike.object.pojo.vo.BatchOperationMsgVO;
import com.tbit.common.entity.view.PageResult;
import com.tbit.uqbike.service.business.tag.validation.group.bind.*;
import com.tbit.uqbike.webmanager.dto.TagBindDTO;
import com.tbit.uqbike.webmanager.req.tag.bind.QueryBindListReq;
import com.tbit.uqbike.webmanager.resp.tag.TagBindListResp;
import com.tbit.uqbike.webmanager.resp.tag.TagResult;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 车辆标签绑定服务
 *
 *
 * @author <a href="mailto:chen.chaoxiong@tbit.com.cn">ChenChaoXiong</a>
 * @since 2024/7/8
 */
@Validated
public interface TagBindService {

    PageResult<List<TagBindListResp>> queryBindListPage(@Valid QueryBindListReq req);

    @Validated(BatchOperationTestGroup.class)
    BatchOperationMsgVO<TagResult> batchTag(@Valid TagBindDTO tagBind);

    BatchOperationMsgVO<TagResult> tagByAccountId(TagBindDTO tagBind);

    @Validated(OperationByMachineIdGroup.class)
    BatchOperationMsgVO<TagResult> tagByMachineId(@Valid TagBindDTO tagBind);


    @Validated(OperationByMachineNoGroup.class)
    BatchOperationMsgVO<TagResult> tagByMachineNo(@Valid TagBindDTO tagBind);

    @Validated(OperationByUserCodeGroup.class)
    BatchOperationMsgVO<TagResult> tagByUserCode(@Valid TagBindDTO tagBind);

    @Validated(OperationByTagIdGroup.class)
    BatchOperationMsgVO<TagResult> cancelByTagId(@Valid TagBindDTO tagBindDTO);

    BatchOperationMsgVO<TagResult> cancelByMachineId(@Valid TagBindDTO tagBindDTO);

    /**
     * 根据设备ID删除标签绑定
     * 因为当前machine 没有逻辑删除，所以这里只能物理删除
     * @param machineIds
     * @return
     */
    void deleteByMachineId(List<Integer> machineIds);

    @Validated(OperationByMachineNoGroup.class)
    BatchOperationMsgVO<TagResult> cancelByMachineNo(@Valid TagBindDTO tagBindDTO);

    @Validated(OperationByUserCodeGroup.class)
    BatchOperationMsgVO<TagResult> cancelByUserCode(@Valid TagBindDTO tagBindDTO);

    @Validated(OperationByTagBindIdGroup.class)
    BatchOperationMsgVO<TagResult> cancelByid(@Valid TagBindDTO tagBindDTO);

}
